<template>
    <div>
        <Input placeholder="请输入包含的字符串" :value="containsVal"/>
    </div>
</template>

<style scoped>

</style>

<script>
export default {
    name: 'StringContains',
    props:['val'],
    computed: {
        containsVal: function(){
            let result = '';
            if(this.val){
                // console.log('StringContain init',this.val);
                // 字符串包含判断工具(contains)的determinationData格式为{"contains":"keyword"}
                let valObj = JSON.parse(this.val);
                if(valObj.containStr){
                    result = valObj.containStr
                }
            }
            return result;
        }
    }
}
</script>
